/*
 * Copyright 2012 Faculty of Informatics - Masaryk University.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cz.muni.fi.pa165.creatures.services;

import cz.muni.fi.pa165.creatures.dto.CreatureDTO;
import cz.muni.fi.pa165.creatures.dto.CreatureTypeDTO;
import cz.muni.fi.pa165.creatures.dto.RegionDTO;
import java.util.List;

/**
 * This service interface offers methods for implementing operations related to
 * {@link cz.muni.fi.pa165.creatures.model.Creature}.
 *
 * @author xmiklos1
 */
public interface CreatureService {

    /**
     * This method creates a {@link cz.muni.fi.pa165.creatures.model.Creature}.
     *
     * @param creature creature to create
     * @return id of the created creature
     */
    Long create(CreatureDTO creature);

    /**
     * This method removes a {@link cz.muni.fi.pa165.creatures.model.Creature}.
     *
     * @param creature creature to remove
     */
    void remove(CreatureDTO creature);

    /**
     * This method updates a {@link cz.muni.fi.pa165.creatures.model.Creature}.
     *
     * @param creature creature to update
     */
    void update(CreatureDTO creature);

    /**
     * This method gets creature by its id.
     *
     * @param id id to get a creature of
     * @return creature of specified {@code id}
     */
    CreatureDTO getById(Long id);

    /**
     * This method gets a {@link cz.muni.fi.pa165.creatures.model.Creature} by
     * its name.
     *
     * @param name name of the creature to get
     * @return creature of specified {@code name}
     */
    CreatureDTO getByName(String name);

    /**
     * This method returns a list of all creatures.
     *
     * @return list of all creatures ordered alphabetically by their name
     */
    List<CreatureDTO> getAll();

    /**
     * This method returns all creatures of some
     * {@link cz.muni.fi.pa165.creatures.model.Region}.
     *
     * @param region region to get all creatures from
     * @return list of creatures which live in
     * {@link cz.muni.fi.pa165.creatures.model.Region}
     */
    List<CreatureDTO> getCreaturesOf(RegionDTO region);

    /**
     * This method returns creatures of some
     * {@link cz.muni.fi.pa165.creatures.model.CreatureType}.
     *
     * @param creatureType creature type to get all creatures of
     * @return list of all creatures of some
     * {@link cz.muni.fi.pa165.creatures.model.CreatureType}
     */
    List<CreatureDTO> getCreaturesOf(CreatureTypeDTO creatureType);

    /**
     * This method returns the count of all creatures.
     *
     * @return number of all {@link cz.muni.fi.pa165.creatures.model.Creature}s
     */
    Long getCount();

    /**
     * This method returns the count of creatures of some
     * {@link cz.muni.fi.pa165.creatures.model.Region}.
     *
     * @param region region to get the count of all creatures living in it of
     * @return number of creatures which live in specified {@code region}
     */
    Long getCountOfCreaturesOf(RegionDTO region);

    /**
     * This method returns the count of creature of some
     * {@link cz.muni.fi.pa165.creatures.model.CreatureType}.
     *
     * @param creatureType creature type we want to get count of creatures of
     * @return number of creatures of specified {@code creatureType}
     */
    Long getCountOfCreaturesOf(CreatureTypeDTO creatureType);

    /**
     * Deletes all creatures.
     */
    void deleteAll();
}
